/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Actividad;

import java.awt.event.ActionListener;
import java.util.Date;
import javax.swing.JButton;

/*_____________________________________________________________________________________________________________________*/
/*_____________________________________________________________________________________________________________________*/
/**
 * <hr>
 * En esta clase se encuentran los metodos necesarios para implemetar una ventana que le permite al docente 
 * ingresar una actividad para ser resuelta por los alumnos. 
 * @author gaston
 * <hr>
 */
/*_____________________________________________________________________________________________________________________*/
/*_____________________________________________________________________________________________________________________*/


public class AgregarActividadView extends javax.swing.JFrame {

    /**
     * Creates new form AgregarActividadView
     */
    public AgregarActividadView() {
        initComponents();
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jAgregar = new javax.swing.JButton();
        jTitulo = new javax.swing.JLabel();
        jActividad = new javax.swing.JLabel();
        jTextoActividad = new javax.swing.JTextField();
        jCancelar = new javax.swing.JButton();
        jLabel1 = new javax.swing.JLabel();
        jLabel2 = new javax.swing.JLabel();
        jLabel3 = new javax.swing.JLabel();
        jDescripcion = new javax.swing.JTextField();
        jCodigoMateria = new javax.swing.JTextField();
        jFechaEntrega = new javax.swing.JTextField();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jAgregar.setText("Agregar");

        jTitulo.setText("Agregar Nueva Actividad            ");

        jActividad.setText("Codigo Actividad");

        jCancelar.setText("Cancelar");

        jLabel1.setText("Descripcion");

        jLabel2.setText("Codigo Materia");

        jLabel3.setText("Fecha de entrega");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addContainerGap(102, Short.MAX_VALUE)
                .addComponent(jTitulo, javax.swing.GroupLayout.PREFERRED_SIZE, 235, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(95, 95, 95))
            .addGroup(layout.createSequentialGroup()
                .addGap(30, 30, 30)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                        .addComponent(jAgregar, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                        .addComponent(jActividad, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                    .addComponent(jLabel3)
                    .addComponent(jLabel2)
                    .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 91, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(37, 37, 37)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jDescripcion, javax.swing.GroupLayout.DEFAULT_SIZE, 231, Short.MAX_VALUE)
                    .addComponent(jFechaEntrega, javax.swing.GroupLayout.DEFAULT_SIZE, 231, Short.MAX_VALUE)
                    .addGroup(layout.createSequentialGroup()
                        .addComponent(jCancelar, javax.swing.GroupLayout.PREFERRED_SIZE, 100, javax.swing.GroupLayout.PREFERRED_SIZE)
                        .addGap(0, 0, Short.MAX_VALUE))
                    .addComponent(jCodigoMateria, javax.swing.GroupLayout.DEFAULT_SIZE, 231, Short.MAX_VALUE)
                    .addComponent(jTextoActividad))
                .addContainerGap())
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, layout.createSequentialGroup()
                .addGap(23, 23, 23)
                .addComponent(jTitulo, javax.swing.GroupLayout.PREFERRED_SIZE, 39, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(24, 24, 24)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jTextoActividad, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jActividad, javax.swing.GroupLayout.PREFERRED_SIZE, 40, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 15, Short.MAX_VALUE)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 23, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jDescripcion, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel2, javax.swing.GroupLayout.PREFERRED_SIZE, 28, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jCodigoMateria, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(18, 18, 18)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jLabel3, javax.swing.GroupLayout.PREFERRED_SIZE, 30, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jFechaEntrega, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addGap(27, 27, 27)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jAgregar, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jCancelar, javax.swing.GroupLayout.PREFERRED_SIZE, 37, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        pack();
    }// </editor-fold>//GEN-END:initComponents

  
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JLabel jActividad;
    private javax.swing.JButton jAgregar;
    private javax.swing.JButton jCancelar;
    private javax.swing.JTextField jCodigoMateria;
    private javax.swing.JTextField jDescripcion;
    private javax.swing.JTextField jFechaEntrega;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JLabel jLabel2;
    private javax.swing.JLabel jLabel3;
    private javax.swing.JTextField jTextoActividad;
    private javax.swing.JLabel jTitulo;
    // End of variables declaration//GEN-END:variables

    /**
     * 
     * @return jAgregar
     */
    public JButton getJbAgregar(){
        return jAgregar;
    }

    /**
     * 
     * @return jCancelar
     */
    public JButton getJbCancelar(){
        return jCancelar;
    }
    
    /**
     * 
     * @return 
     */
    public String getTextoActividad(){
        return jTextoActividad.getText();
    }

    /**
     * 
     * @return 
     */
    public String getDescripcion(){
        return jDescripcion.getText();
    }

    /**
     * 
     * @return 
     */
    public String getCodigoMateria(){
        return jCodigoMateria.getText();
    }
    
    /**
     * 
     * @return jFechaEntrega
     */
    public String getFechaEntrega(){
        return jFechaEntrega.getText();
    }
    
    /**
     * 
     * @param descripcion 
     */
    public void setDescripcion(String descripcion){
        this.jDescripcion.setText(descripcion);
    }
    
    /**
     * 
     * @param texto 
     */
    public void setTextoActividad(String texto){
        this.jActividad.setText(texto);
    }
    
    /**
     * 
     * @param cadigoMateria 
     */
    public void setCodigoMateria(String cadigoMateria){
        this.jCodigoMateria.setText(cadigoMateria);
    }
    
    /**
     * 
     * @param fecha 
     */
    public void setFechaEntrega(Date fecha){  //Hacer parser
        this.jFechaEntrega.setText(fecha.toString());
    }
    

    /**
     * 
     * @param accion 
     */
    public void setActionListener(ActionListener listener){
        jAgregar.addActionListener(listener);
        jCancelar.addActionListener(listener);
    }

    /**
     * 
     * @param ac 
     */
    public void setWindowListener(AgregarActividadController ac){
        this.addWindowListener(ac);
    }
    
    
}//Fin de la clase AgregarActividadView.
